<?php

/**
 * Folder form.
 *
 * @package    sf_portal
 * @subpackage form
 * @author     Your name here
 * @version    SVN: $Id: sfPropelFormTemplate.php 10377 2008-07-21 07:10:32Z dwhittle $
 */
class FolderForm extends BaseFolderForm
{
  public function configure()
  {
  	unset( 
  		$this['created_at'],  
  		$this['tree_left'],
  		$this['tree_right'],
  		$this['tree_parent'],
  		$this['alias'],
  		$this['scope'],
  		$this['count'],
  		$this['user_id'],
  		$this['mat2_folder_list']	
  		);
  	
  		
  		$this->setWidgets(array(
      'id'               => new sfWidgetFormInputHidden(),
      'name' =>  new sfWidgetFormInput(array(),array('style'=>'width:200px')),
  	  'description' => new sfWidgetFormTextarea(array(),array('style'=>'width:200px')),
  	  'photo_path' => new sfWidgetFormInputFile (  ), 	
  	  'seo_title' =>  new sfWidgetFormInput(array(),array('style'=>'width:200px')),
  	  'seo_description' => new sfWidgetFormTextarea(array(),array('style'=>'width:200px')),
  	  'seo_keyword' => new sfWidgetFormTextarea(array(),array('style'=>'width:200px'))	
    ));
  		
  		
  		$this->widgetSchema->setLabels(array(  
		'name'    => 'Наименование',  
		'description'   => 'Теги',  
  		'photo_path' => 'Иконка'
  	     ));
  	     
  	    $this->validatorSchema['photo_path'] = new sfValidatorFile(array(
        'required'   => false,
        'path'       => sfConfig::get('sf_web_dir').'/uploads/folder',
        'mime_types' => 'web_images',
        'max_size'   => 500000, // 360 kB,
  		  'validated_file_class' => 'sfFolderValidatedFile'
        )); 
  	     
  		 $this->widgetSchema->setNameFormat('folder[%s]');
  		
  }
}
